package File

import (
	"io"
	"os"
)

func CopyFile(dstName string, srcName string) (int64, error) {
	src, err := os.Open(srcName)
	if err != nil {
		panic(err)
	}
	defer src.Close()
	dst, err := os.OpenFile(dstName, os.O_CREATE|os.O_WRONLY, 0644)
	if err != nil {
		panic(err)
	}
	defer dst.Close()
	return io.Copy(dst, src)
}
